﻿#include "stdafx.h"
#include "XBrowserIntParser.h"

#include "XBSTR.h"
#include "XString.h"
#include "Util.h"
#include "IXBrowser.h"

#include "ParseHelper.h"


CXBrowserIntParser::CXBrowserIntParser() : CXIntParserBase(&TIntCreateControl<IXBrowser>)
{
    ;
}

CXBrowserIntParser::~CXBrowserIntParser()
{
    ;
}

// 填充属性
BOOL CXBrowserIntParser::FillAttr(IN IXConfigNode* pNode, IN IXControl* pControl)
{
    BOOL bResult = m_ParentParser.FillAttr(pNode, pControl);
    if(!bResult)
        return bResult;

    XBSTR bstrTemp;

    IXBrowser* pBrowser = Util::QueryIntf<IXBrowser>(pControl);
    if(pBrowser == NULL)
        return FALSE;

    // URL
    if(SUCCEEDED(pNode->GetValue(_T("url"), &bstrTemp)))
    {
        pBrowser->Navigate(bstrTemp);
    }

    return bResult;
}
